from app.controllers.artist.all_artist_controller import AllArtistsPage
from app.controllers.artist.artist_controller import ArtistPage
from app.controllers.error_controller import ErrorPage
from app.controllers.import_data_controller import ImportDataPage
from app.controllers.song.add_song_controller import AddSongPage
from app.controllers.song.all_song_controller import AllSongsPage
from app.controllers.song.song_controller import SongPage
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from helloworld import MainPage
from google.appengine.ext.webapp import template

template.register_template_library('app.helpers.django_filters')

application = webapp.WSGIApplication([
  ('/', MainPage),
  ('/artist', AllArtistsPage),
  ('/artist/(.*)/(.*)', ArtistPage),
  ('/artist/(.*)', ArtistPage),
  ('/song', AllSongsPage),
  ('/import', ImportDataPage),
  ('/song/(.*)/(.*).html', SongPage),
  ('/song/add.html', AddSongPage),
  ('.*', ErrorPage)
], debug=True)


def main():
    run_wsgi_app(application)

if __name__ == '__main__':
    main()
